package cn.exempale.mscapplication.utils;

import android.util.Log;

import java.security.SignatureException;

import cn.exempale.mscapplication.constant.BaseConstant;
import cn.exempale.mscapplication.dto.BaseDTO;

public final class AudioUtils {

    private static final String TAG = "AudioUtils";

    public static String getSigna(BaseDTO baseDTO) {
        try {
            String baseString = baseDTO.getApp_id() + baseDTO.getTs();
            String baseMD5 = EncryptUtil.MD5(baseString);
            assert baseMD5 != null;
            return EncryptUtil.HmacSHA1Encrypt(baseMD5, BaseConstant.SECRET_KEY);
        } catch (SignatureException e) {
            e.printStackTrace();
            Log.e(TAG, "生成签名异常:", e);
        }
        return "";
    }
}
